import { simplify } from './simplify';
import { Expression, BoolOperation } from './types';

/**
 * 求表达式交集
 */
export function intersection(expA: Expression, expB: Expression): Expression {
  const unionExp = {
    operator: BoolOperation.AND,
    args: [expA, expB],
  };

  return simplify(unionExp);
}
